package com.rocpenghua.ocr;

import org.apache.tika.Tika;
import org.apache.tika.exception.TikaException;
import org.xml.sax.SAXException;

import java.io.FileInputStream;
import java.io.IOException;

/**
 * @author pengp
 * @date 2024年02月22日 17:57
 */
public class TestTika {
    public static void main(String[] args) throws TikaException, IOException, SAXException {
        String filePath = "E://soft//ocr//tika//TestTika.java";

//        filePath = "E://soft//ocr//tika//movie.mp4";
//        filePath = "E://soft//ocr//tika//0.png";
        Tika tika = new Tika();
        final String result = tika.parseToString(new FileInputStream(filePath));
        System.out.println(result);
    }

}
